<template>
	<div class="demo">
		<h2>学生姓名：{{name}}</h2>
		<h2>学生性别：{{sex}}</h2>
		<h2>学生年龄：{{age}}</h2>
	</div>
</template>

<script>
	export default {
		name: 'Student',
		data() {
			return {
				myAge:this.age
			}
		},
		// props:['name','sex','age']
		/* props: {
			name: String,
			sex: String,
			age: Number
		} */
		props:{
			name:{
				type:String,
				required:true
			},
			sex:{
				type:String,
				default:'男'
			},
			age:{
				type:Number,
				required:true
			}
		}
	}
</script>

<style>
	.demo {
		background-color: orange;
	}
</style>
